package edu.sctu.xialei.May.day20150520one;

import java.util.Scanner;

/**
 * Created by Administrator on 5/20/2015.
 */
public class Counter {

    public float counter(float num1, float num2) {

        float countResult ;

        System.out.println("选择运算符号");
        System.out.println("1、加法    2、减法    3、乘法    4、除法");
        Scanner inputSign = new Scanner(System.in);

        switch (inputSign.nextInt()){

            case 1 : countResult =  (num1 + num2);break;
            case 2 : countResult =  (num1 - num2);break;
            case 3 : countResult =  (num1 * num2);break;
            case 4 : countResult =  (num1 / num2);break;
            default  : countResult = 0;             break;
        }

        return countResult;
    }
}
